home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: delta / whiteline CD Series - delta.iso / tools / utils / twtcp122 / pktdrv / pktdlink / lancexb.s < prev    next >
Text File  |  1995-11-25  |  2KB  |  99 lines

  1. ;/********************************************************************/
  2. ;/*                                                                    */
  3. ;/*    Packet driver for D-LINK ethernet controller                    */
  4. ;/*                                                                    */
  5. ;/*    Copyleft by P. Mayer, 1992 TU-Vienna IAEE                        */
  6. ;/*    All rights reserved                                                */
  7. ;/*                                                                    */
  8. ;/********************************************************************/
  9.  
  10.  
  11.     .text
  12.     .super
  13.     
  14.     xdef    lance_interrupt
  15.     xdef    lance_200interrupt
  16.     xdef    old200
  17.     xdef    clock
  18.     
  19.     xref    new_stack
  20.     xref    old_stack
  21.     xref    ihandler
  22.     xref    locked200
  23.     
  24. ;lance_200interrupt:
  25. ;        tst.b    locked200
  26. ;        bne.b    no200handler2
  27. ;        movem.l d0-d7/a0-a6,-(a7)
  28. ;         move.l    a7,old_stack
  29. ;         lea        new_stack,a7
  30. ;         movea.l    ihandler,a0
  31. ;         beq        no200handler
  32. ;         jsr        (a0)
  33. ;no200handler:
  34. ;         movea.l    old_stack,a7
  35. ;         movem.l (a7)+,d0-d7/a0-a6
  36. ;no200handler2:
  37. ;         move.l  old200, -(a7)
  38. ;         rts
  39.  
  40. OLD_STACK:    dc.l    0
  41.  
  42.     .bss
  43.     .even
  44.             DS.W    512
  45. NEW_STACK:
  46.             DS.W    10
  47.  
  48.     .text
  49.             .DC.L    'XBRADLNK'
  50. old200:        dc.l    0
  51.  
  52. lance_200interrupt:
  53.                                         ; test semaphore
  54.             tst.b    locked200
  55.             bne        H200_EXIT            ; inet busy -> jump
  56.             or.b    #$80,locked200
  57.             move    (a7),savesr
  58.             move.l    2(a7),savepc
  59.             move.l    #myrout,2(a7)
  60.  
  61.             move.l    d0,-(a7)
  62.             move    savesr,d0
  63.             and        #$ffff,d0
  64.             or        #$2000,d0
  65.             move    d0,4(a7)
  66.             move.l    (a7)+,d0
  67.             bra.s    EXIT2
  68.             
  69. H200_EXIT:
  70.             and.b    #$7f,locked200
  71. EXIT2:      move.l    old200,-(a7)
  72.             rts                            ; jump to old handler
  73.             
  74. myrout:        
  75.             move.l    a7,OLD_STACK
  76.             movea.l    #NEW_STACK,a7        ; install new stack
  77.             movem.l    d0-a6,-(a7)            ;
  78.  
  79.             tst.l    ihandler            
  80.             beq        no200handler
  81.              movea.l    ihandler,a0
  82.             jsr        (a0)
  83. no200handler:
  84.             movem.l    (a7)+,d0-a6
  85.             move.l    OLD_STACK,a7
  86.  
  87.             move.l    savepc,-(a7)
  88.             move    savesr,-(a7)
  89.             clr.b    locked200
  90.             rte
  91.             
  92. clock:      move.l $4ba,d0                ; 
  93.             rts
  94.  
  95. savepc:        dc.l 0
  96. savesr:        dc.l 0
  97. locked200:    dc.w 0
  98.  
  99.